//
//  TGMBaseTableCell.m
//  TravelGuideMdd
//
//  Created by HanFeng on 24/11/14.
//  Copyright (c) 2014 mafengwo.com. All rights reserved.
//

#import "TGMBaseTableCell.h"

@implementation TGMBaseTableCell {
    BOOL __initialized;
}

- (void)dealloc
{
    [NSObject cancelPreviousPerformRequestsWithTarget:self];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self __initialize];
    }
    return self;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self __initialize];
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self __initialize];
    }
    return self;
}

// NOTE：使用awakeFromNib作为初始化方法，因为那个时候其subviews都会被创建
//- (instancetype)initWithCoder:(NSCoder *)coder
//{
//    self = [super initWithCoder:coder];
//    if (self) {
//        [self initializeView];
//    }
//    return self;
//}

- (void)awakeFromNib
{
    [super awakeFromNib];
    [self __initialize];
}

- (void)__initialize
{
    if (__initialized == NO) {
        [self initializeView];
        __initialized = YES;
    }
}

- (void)initializeView
{
    
}

@end
